package cn.itsource.client;

import cn.itsource.domain.Order;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OrderServiceClientFallbackFactory implements FallbackFactory<OrderServiceClient> {
    @Override
    public OrderServiceClient create(Throwable throwable) {
        return new OrderServiceClient() {
            @Override
            public Order getById(Long id) throws Throwable {
                throw throwable;
                //return new Order(-1L,"系统繁忙！");
            }
        };
    }
}
